package huanzhao.erp.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import huanzhao.erp.domain.types.NotificationType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

@TableName(value = "notification_core")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NotificationCore implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 发送时间
     */
    @TableField(value = "send_time")
    private Date sendTime;

    /**
     * 通知内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 相关id
     */
    @TableField(value = "relate_id")
    private Long relateId;

    /**
     * 通知类型
     */
    @TableField(value = "type")
    private NotificationType type;

    public NotificationCore(NotificationType notificationType, String content, Long relateId) {
        this.type = notificationType;
        this.content = content;
        this.relateId = relateId;
    }

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}